<!DOCTYPE html>

<html class="no-js">

<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title></title>
  <meta name="description" content="" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />

  <script src="https://cdn.staticfile.org/axios/0.19.0-beta.1/axios.js"></script>

  <script src="../../cdn/vue/vue.global.min.js"></script>

  <link rel="stylesheet" href="../../cdn/element-plus/index.css" />
  <script src="../../cdn/element-plus/index.full.min.js"></script>
  <link rel="stylesheet" href="../../../lib/index.css" />
  <script src="../../../lib/avue.js"></script>
</head>

<body>
  <div id="app">
    <avue-tabs ref="tabs" :option="option" @change="handleChange"></avue-tabs>
    <span v-if="type.prop==='tab1'">选项卡内容1</span>
    <span v-else-if="type.prop==='tab2'">选项卡内容2</span>
  </div>
</body>
<script>
  var app = Vue.createApp({
    data() {
      return {
        type: {},
        option: {
          // position: 'left',//left|right|top|bottom
          column: [{
            label: '选项卡1',
            prop: 'tab1',
            icon: 'el-icon-edit',
          }, {
            label: '选项卡2',
            prop: 'tab2',
            icon: 'el-icon-date',
          }]
        }
      }
    },
    created() {
      this.type = this.columnOption[0]
    },
    mounted() {
      // this.$refs.tabs.changeTabs(1);
    },
    computed: {
      columnOption() {
        return this.option.column || [];
      }
    },
    methods: {
      handleChange(tabs) {
        this.type = tabs
      }
    }
  })
  app.use(ElementPlus)
  app.use(AVUE)
  app.mount('#app')
</script>

</html>